
<!--#include file="functions.asp" -->

<%
'on error resume next
'set cn=Server.CreateObject("ADODB.Connection")
'cn.Open "MP2ENTTEST2", "MP2", "MP2"
dim sql

sql ="UPDATE EXIREG SET INVSTATUS='PAID',"
sql = sql & " PAYMENTDATE='" & request("Payment_Date") & "',"
sql = sql & " AMOUNTPAID=" & delKoma(request("total_amt"))
sql = sql & " WHERE SEQNUM=" & request("seqnum")
cn.execute(sql)

sql = "SELECT TOP 1 * FROM EXIHIST WHERE SEQNUM=" & request("seqnum") & " ORDER BY DATE DESC"
set rs=cn.execute(sql)

'update EXIHIST
  sql = "INSERT INTO EXIHIST (SEQNUM, TRANSTYPE,LOCATION,DEPARTMENT,DATE,UPDATEUSER,UPDATESTAMP)"
  sql = sql & " VALUES ("
  sql = sql & request("seqnum") & ",'"
  sql = sql & "IPD','"
  sql = sql & rs("LOCATION") & "','"
  sql = sql & rs("DEPARTMENT") & "',"
  sql = sql & "GETDATE(),'"
  sql = sql & usrName & "',"
  sql = sql & "GETDATE() )"
  
  cn.execute(sql)
  set rs=nothing
  
 response.redirect "inv_payment.asp"
%>
